import request from '@/utils/request'

// 获取参数列表数据
export const getParamsData = (cateId, sel) => request.get(`categories/${cateId}/attributes`, { params: { sel } })

// 添加动态参数或静态属性
export const addParams = (cateId, attr) => request.post(`categories/${cateId}/attributes`, attr)

// 获取参数信息
export const getParams = (cateId, attrId, attrSel) => request.get(`categories/${cateId}/attributes/${attrId}`, { attr_sel: attrSel })

// 修改参数信息
export const modifyParams = (cateId, attrId, attr) => request.put(`categories/${cateId}/attributes/${attrId}`, attr)

// 删除参数
export const deleteParams = (cateId, attrId) => request.delete(`categories/${cateId}/attributes/${attrId}`)
